// 交易市场管理
import request from '@/utils/request'

export default{
  /**
   * @description: 添加 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
   add(params){
    const url = "/socialized-market/market/add"
    return request.post(url,{...params})
  },

  /**
   * @description: 修改 *代表必填
   * @param {Object} params *
   * @return {Object}
   */ 
   edit(params){
    const url = "/socialized-market/market/edit"
    return request.put(url,{...params})
  },

  /**
   * @description: 编号删除 *代表必填
   * @param {String/Number} staffId *
   * @return {Object}
   */
  //  delById(id){
  //   const url = "/socialized-market/market/del?id="+id
  //   return request.post(url)
  // },
  delById(params){
    const url = `/socialized-market/market/del?marketId=${params.marketId}`
    return request.post(url,params)
  },

  /**
   * @description: 编号批量删除 *代表必填
   * @param {String/Number} staffId *
   * @return {Object}
   */
   delListById(idList){
     const url = `/socialized-market/market/delList?marketIdList=${idList}`
     return request.delete(url)
   },

  /**
   * @description: 条件查询 *代表必填
   * @param {String/Number} staffId *
   * @return {Object}
   */
  queryByCondition(params){
    const url = "/socialized-market/market/queryByCondition"
    return request.post(url,{...params})
  },

  /**
   * @description: 分页查询 *代表必填
   * @param {Object} params *
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @return {Object}
   */
   queryPageByCondition(params){
    const url = "/socialized-market/market/queryPageIncludeGoods"
    return request.post(url,{...params})
  },

    /**
   * @description: 下载模板 *代表必填
   */
     fileDownload(id){
      // const url = `/socialized-market/marketQuotation/downloadTemplate`
      const url = `/socialized-market/marketQuotation/downloadTemplate?marketId=${id}`
      return request.get(url,{
        responseType: 'blob'
      })
    },

  // /**
  //  * @description: 数据导入 *代表必填
  //  */
  //  toImport(params){
  //   const url = "/socialized-market/marketQuotation/excelImport"
  //   return request.post(url,{...params})
  // },
}
